package cn.smbms.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.smbms.dao.ProviderMapper;
import cn.smbms.pojo.Provider;

@Service
public class ProviderService implements ProviderServiceI {
	@Resource
	private ProviderMapper providerDao;

	/* (non-Javadoc)
	 * @see cn.smbms.service.ProviderServiceI#getAllNameAndId()
	 */
	@Override
	public List<Provider> getAllNameAndId() {
		return providerDao.getAllNameAndId();
	}

	/* (non-Javadoc)
	 * @see cn.smbms.service.ProviderServiceI#getPageByProName(java.lang.String, java.lang.Integer)
	 */
	@Override
	public List<Provider> getPageByProName(String proName, Integer pageNo) {
		return providerDao.getPageByProName(proName, pageNo);
	}

	/* (non-Javadoc)
	 * @see cn.smbms.service.ProviderServiceI#count(java.lang.String)
	 */
	@Override
	public int count(String proName) {
		return providerDao.count(proName);
	}

	/* (non-Javadoc)
	 * @see cn.smbms.service.ProviderServiceI#getProviderById(java.lang.Integer)
	 */
	@Override
	public Provider getProviderById(Integer id) {
		return providerDao.getProviderById(id);
	}

	/* (non-Javadoc)
	 * @see cn.smbms.service.ProviderServiceI#addProvider(cn.smbms.pojo.Provider)
	 */
	@Override
	public int addProvider(Provider p) {
		return providerDao.addProvider(p);
	}

	/* (non-Javadoc)
	 * @see cn.smbms.service.ProviderServiceI#updateProvider(cn.smbms.pojo.Provider)
	 */
	@Override
	public int updateProvider(Provider p) {
		return providerDao.updateProvider(p);
	}

	/* (non-Javadoc)
	 * @see cn.smbms.service.ProviderServiceI#deleteProvider(java.lang.Integer)
	 */
	@Override
	public int deleteProvider(Integer id) {
		return providerDao.deleteProvider(id);
	}
}
